package com.tdrc.common.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author dpf
 * @version 1.0
 * @date 2020-4-13 9:54
 * @instruction ...
 */
@Aspect
@Component
public class RepeatSubmitAspect {
    @Resource
    HttpServletRequest request;
    @Pointcut("@annotation(com.tdrc.common.annotation.RepeatSubmit)")
    public void pointcut() {

    }
    @Around(value = "pointcut()")
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        String userToken = request.getParameter("token");
        return null;
        /*Map<String,Object> map = new HashMap<String,Object>();
        if(userTokenUtil.isEffect(userToken)) {
            return joinPoint.proceed();
        }else {
            map.put("code", 203) ;
            return map;
        }*/
    }
}
